export const validateRegisterInput = (
  username: string,
  email: string,
  password: string,
  confirmPassword: string
) => {
  if (username.trim() === '') {
    return ' username must not be empty';
  }
  if (email.trim() === '') {
    return ' email must not be empty';
  } else {
    // eslint-disable-next-line no-useless-escape
    const regEmail = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/;
    if (!email.match(regEmail)) {
      return 'email must be a vaild email address';
    }
  }
  if (password.trim() === '') {
    return ' password must not be empty';
  } else if (password !== confirmPassword) {
    return 'The password and confirmation password must be the same';
  }
}
export const validateLoginInput = (
  username: string,
  password: string,
) => {
  if (username.trim() === '') {
    return 'username must not be empty';
  }
  if (password.trim() === '') {
    return 'password must not be empty';
  }
}